package edu.hawaii.duedates.webApp;

import edu.hawaii.duedates.DueDates;

import org.apache.wicket.behavior.HeaderContributor;
import org.apache.wicket.markup.html.WebPage;

/**
 * This is the base Page class for all pages in the DueDates
 * application. All pages in Due Dates will inherit the 
 * basic functionalities of this class. The default css 
 * styling is outlined in this class as well.
 * 
 * @author Mari-Lee Flestado, Tyler Wolff, Aric West
 *
 */
public class DueDatesPage extends WebPage {
  
  /** Support serialization. */
  private static final long serialVersionUID = 1L;
  
  /**
   * Default constructor.
   */
  public DueDatesPage() {
    // Add CSS definitions for use in all pages
    add(HeaderContributor.forCss(
        edu.hawaii.duedates.webApp.DueDatesPage.class, "style/mainstyle.css", "screen"));      
  }
  
  /**
   * Returns the session instance associated with the current user.
   * 
   * @return The DueDatesSession.
   */
  protected DueDatesSession getDueDatesSession() {
    return (DueDatesSession) getSession();
  }

  /**
   * Returns the due dates object for this session.
   * 
   * @return The due dates object for this session.
   */
  public DueDates getDueDates() {
    return getDueDatesSession().getDueDatesObject();
  }

}
